<template>
    <div class="ChangeCardItem">
        <el-row>
            <el-col :span="20" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">账户类别:</span>
                        <span class="el-form-item-span">{{ChangeCardSuccess.CATEGORY_filter}}</span>
                    </div>
                </div>
            </el-col>
            <el-col :span="20" :offset="1">
                <div class="text_center width30">
                    <div class="el-form-item-span-wrap">
                        <span class="el-form-item-span-label">卡号:</span>
                        <span class="el-form-item-span">{{ChangeCardSuccess.body.appBody.CARDNBR}}</span>
                    </div>
                </div>
            </el-col>
            <el-col :span="22">
                <div
                    class="text_span text_center"
                >{{successText}} 新卡号：{{ChangeCardSuccess.body.appBody.CARDNBRNEW}} ！</div>
            </el-col>
        </el-row>
        <div class="text_center margin_top20">
            <el-button
                type="primary"
                size="small"
                @click="handleClose"
                icon="el-icon-circle-check"
                v-preventReClick
            >确定</el-button>
            <el-button type="primary" size="small" @click="handleClickbtn">修改记录查询</el-button>
            <el-button size="small" @click.native="handleClose">关闭</el-button>
        </div>
    </div>
</template>

<script>
import { closePage } from '@/utils/Common';

export default {
    name: 'ChangeCardItem',
    props: {
        ChangeCardSuccess: {
            type: Object,
        },
    },
    data() {
        return {};
    },
    computed: {
        successText() {
            let value;
            if (this.ChangeCardSuccess.sysHead.rspDesc === '交易成功') {
                value = `${this.ChangeCardSuccess.sysHead.busiName} ${this.ChangeCardSuccess.sysHead.rspDesc}`;
            } else {
                value = `错误码：${this.ChangeCardSuccess.sysHead.rspCd} ` + `错误信息：${this.ChangeCardSuccess.sysHead.rspMsg}`;
            }

            return value;
        },
    },
    methods: {
        // 点击关闭
        handleClose() {
            closePage(this.$route, this, 1);
        },
        handleClickbtn() {
            this.$router.push({
                path: '/businessSystem/accountCardDetaileQuery',
            });
        },
    },
};
</script>
<style lang='scss'>
.ChangeCardItem {
    .text_span {
        margin: 15px 20px;
        font-size: 16px;
    }
    .text_fl {
        margin-bottom: 5px;
    }
}
</style>
